#define  _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<math.h>

int main()
{
	int n;
	scanf("%d", &n);
	for (int p = 0;p < n;p++)
	{
		int a[9][9] = { 0 }, b[9][9] = { 0 };
		int flag = 0;

		for (int i = 0;i < 9;i++)
		{

			for (int j = 0;j < 9;j++)
			{
				scanf("%d", &a[i][j]);
			}
		}


		for (int i = 0;i < 9;i++)
		{
			for (int j = 0;j < 9;j++)
			{
				scanf("%d", &b[i][j]);
			}
		}


		for (int i = 0;i < 9;i++)
		{
			if (flag == 1)
				break;
			for (int j = 0;j < 9;j++)
			{
				if (a[i][j] == 0)
					continue;
				else if (a[i][j] == b[i][j])
					continue;
				else
				{
					printf("Moca is so careless!\n");
					flag = 1;
					break;
				}
			}
		}


		if (flag == 0)
		{
			for (int i = 0;i < 9;i++)
			{
				if (flag == 1)
					break;
				int c[10] = { 0 };
				for (int j = 0;j < 9;j++)
				{
					if (flag == 1)
						break;
					c[b[i][j]]++;
					if (j == 8)
					{
						for (int m = 1;m <= 9;m++)
						{
							if (c[m] != 1)
							{
								printf("Moca is so careless!\n");
								flag = 1;
								break;
							}
						}
					}
				}
			}



			for (int j = 0;j < 9;j++)
			{
				if (flag == 1)
					break;
				int c[10] = { 0 };
				for (int i = 0;i < 9;i++)
				{
					if (flag == 1)
						break;
					c[b[i][j]]++;
					if (i == 8)
					{
						for (int m = 1;m <= 9;m++)
						{
							if (c[m] != 1)
							{
								printf("Moca is so careless!\n");
								flag = 1;
								break;
							}
						}
					}
				}
			}



			for (int i0 = 0;i0 < 3;i0++)
			{
				if (flag == 1)
					break;
				for (int j0 = 0;j0 < 3;j0++)
				{
					if (flag == 1)
						break;
					int c[10] = { 0 };
					for (int i = i0 * 3;i < 3 + i0 * 3;i++)
					{
						if (flag == 1)
							break;
						for (int j = j0 * 3;j < 3 + j0 * 3;j++)
						{
							if (flag == 1)
								break;
							c[b[i][j]]++;
							if (i == 2 + i0 * 3 && j == 2 + j0 * 3)
							{
								for (int m = 1;m <= 9;m++)
								{
									if (c[m] != 1)
									{
										printf("Moca is so careless!\n");
										flag = 1;
										break;
									}
								}
							}
						}
					}
				}
			}
		}

		if (flag == 0)
			printf("Moca finish this sudoku perfectly!\n");
	}

	return 0;
}